package com.story.modular.app.service.impl;

import com.baomidou.mybatisplus.mapper.EntityWrapper;
import com.baomidou.mybatisplus.mapper.Wrapper;
import com.baomidou.mybatisplus.plugins.Page;
import com.story.common.persistence.model.CategoryClass;
import com.story.common.persistence.model.pageclass;
import com.story.modular.app.dao.CategoryclassDao;
import com.story.modular.app.dao.pageclassMapper;
import com.story.modular.app.service.ICategoryclassService;
import com.story.modular.app.service.IPageclassService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import java.util.List;

/**
 * 首页类别Service
 *
 * @author fengshuonan
 * @Date 2020-04-29 15:42:54
 */
@Service
public class PageclassServiceImpl implements IPageclassService {


    @Autowired
    private pageclassMapper pageclassMapper;

    @Override
    public int save(pageclass record) {
        return pageclassMapper.insert(record);
    }

    @Override
    public int delete(pageclass record) {
        return pageclassMapper.deleteById(record.getId());
    }

    @Override
    public int delete(List<pageclass> records) {
        return 0;
    }

    @Override
    public pageclass findById(Integer id) {
        return pageclassMapper.selectById(id);
    }

    @Override
    public int update(pageclass record) {
        return pageclassMapper.updateById(record);
    }

    @Override
    public List<pageclass> quyerList(pageclass record) {
        Wrapper<pageclass> wrapper = new EntityWrapper<>();

        return pageclassMapper.selectList(wrapper);
    }

    @Override
    public List<pageclass> queryPageList(Page<pageclass> page, String name) {
        return pageclassMapper.queryPageList(page,name);
    }
}
